@extends('admin.public')

@section('content')

    <div class="col-md-12">
        <section class="panel panel-default text-sm doc-buttons">
            <div class="panel-body">
                @if((bool)\Auth::guard('admin')->user()->is_root)
                    <a href="{{ route('admin.index.help_add') }}" class="btn btn-info">
                        <i class="icon-plus ico"></i>
                        &nbsp; 添加帮助信息
                    </a>
                @endif
                <a href="{{ route('admin.index.opinion') }}" class="btn btn-danger">
                    <i class="icon-envelope-open ico"></i>
                    &nbsp; 意见反馈
                </a>
            </div>
        </section>
    </div>


    <div class="col-lg-12">
        <div class="panel-group m-b" id="accordion2">
            @foreach($helps as $k => $help)
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2"
                           href="#collapse{{ $k }}">
                            <span class="text-info m-r">{{ $help->name}}</span>
                            <span class="text-success m-t m-r">{{ $help->updated_at }}</span>
                        </a>
                        @if((bool)\Auth::guard('admin')->user()->is_root)
                            <a href="{{ route('admin.index.help') }}?del={{ $help->id }}"
                               class="btn btn-xs btn-default pull-right">删除</a>
                            <a href="{{ route('admin.index.help_edit',$help->id) }}"
                               class="btn btn-xs btn-default pull-right m-r">编辑</a>
                        @endif
                    </div>
                    <div id="collapse{{ $k }}" class="panel-collaps collapse {{ $k==0 ? 'in' : '' }}">
                        <div class="panel-body text-sm">{!! $help->describe !!}</div>
                    </div>
                </div>
            @endforeach
        </div>
    </div>
@endsection

@section('css')
@endsection

@section('js')
@endsection